import request from "@/utils/request";

/**
 * 费用租赁列表
 * @returns {*}
 */
export function getBaseVenuePriceList() {
  return request({
    url: "/systemj/baseVenuePrice/list",
    method: "get",
  });
}

/**
 * 编辑费用租赁设置
 * @param data
 * @returns {*}
 */
export function modifyBaseVenuePrice(data) {
  return request({
    url: "/systemj/baseVenuePrice",
    method: data.id ? "put" : "post",
    data: data,
  });
}

/**
 * 删除费用租赁设置
 * @param id
 * @returns {*}
 */
export function delBaseVenuePrice(id) {
  return request({
    url: `/systemj/baseVenuePrice/${id}`,
    method: "delete",
  });
}

/**
 * 获取退订规则列表
 * @returns {*}
 */
export function getCancelRuleList() {
  return request({
    url: "/systemj/cancelRule/manageList",
    method: "get",
  });
}

/**
 * 退订规则设置
 * @param data
 * @returns {*}
 */
export function modifyCancelRule(data) {
  return request({
    url: "/systemj/cancelRule/manage",
    method: data.id ? "put" : "post",
    data: data,
  });
}

/**
 * 删除退订规则
 * @param id
 * @returns {*}
 */
export function delCancelRule(id) {
  return request({
    url: `/systemj/cancelRule/${id}`,
    method: "delete",
  });
}

/**
 * 获取项目
 * @returns {*}
 */
export function getBaseProjectList(params) {
  return request({
    url: "/systemj/baseProject/list",
    method: "get",
    params: params,
  });
}

/**
 * 编辑项目
 * @param data
 * @returns {*}
 */
export function modifyBaseProject(data) {
  return request({
    url: "/systemj/baseProject",
    method: data.id ? "put" : "post",
    data: data,
  });
}

/**
 * 删除项目
 * @param id
 * @returns {*}
 */
export function delBaseProject(id) {
  return request({
    url: `/systemj/baseProject/${id}`,
    method: "delete",
  });
}

// 获取流水
export function getCaptialFlowList(params) {
  return request({
    url: "/systemj/captialFlow/listCust",
    method: "get",
    params: params,
  });
}
// 获取会员
export function getMemberListAll(params) {
  return request({
    url: "/systemj/member/listAll",
    method: "get",
    params: params,
  });
}

// 获取场馆列表
export function venueListAll(params) {
  return request({
    url: "/systemj/venue/listAll",
    method: "get",
    params: params,
  });
}

export function getVenueYYInfo(id) {
  return request({
    url: `/systemj/venue/getVenueYYInfo/${id}`,
    method: "get",
  });
}

// 消费记录和充值记录
// url上传memberId，然后消费type=1 充值 type=0都是url上传
export function getRecordByMemberId(params) {
  return request({
    url: "/systemj/memberBalanceFlow/list",
    method: "get",
    params: params,
  });
}

// 平台保险设置
// 获取平台保险信息
export function getInit(params) {
  return request({
    url: "/system/config/platformInsure",
    method: "get",
    params: params,
  });
}
// 修改平台保险信息
export function updatedInit(data) {
  return request({
    url: "/system/config/editPlatFormInsure",
    method: "put",
    data: data,
  });
}

// 查看场馆费方信息
export function getCharge(params) {
  return request({
    url: "/systemj/venue/account",
    method: "get",
    params: params,
  });
}

// 修改场馆收款方信息
export function updatedCharge(data) {
  return request({
    url: "/systemj/venue/edit/account",
    method: "put",
    data: data,
  });
}

/**
 * 查看小程序装修配置
 * @param params
 * @returns {*}
 */
export function appletsRen(params) {
  return request({
    url: "/system/config/appletsRens",
    method: "get",
    params: params,
  });
}

/**
 * 修改小程序装修配置
 * @param data
 * @returns {*}
 */
export function editAppletsRen(data) {
  return request({
    url: "/system/config/editAppletsRens",
    method: "put",
    data: data,
  });
}
